using System;
using System.Collections.Generic;

namespace Kaleida.ServiceMonitor.Framework
{
    public class MonitoringSession
    {
        private readonly IDictionary<string, object> items = new Dictionary<string, object>();

        public object this[string key]
        {
            get { return items.ContainsKey(key) ? items[key] : null; }
            set
            {
                lock (items)
                {
                    if (!items.ContainsKey(key))
                        items.Add(key, null);
                }

                items[key] = value;
            }
        }
    }
}